package com.health.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.health.entity.PageResult;
import com.health.entity.QueryPageBean;
import com.health.entity.Result;
import com.health.service.OrderService;
import com.health.service.OrderSettingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Classname OrderController
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/3/18 18:03
 * @Author RainGrd
 */
@RestController
@Slf4j
@RequestMapping("/order")
public class OrderController {

    @Reference
    private OrderService orderService;

    @Reference
    private OrderSettingService orderSettingService;


    @RequestMapping("/findPage.do")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean) {
        return orderService.queryOrderForPage(queryPageBean);
    }

    @RequestMapping("/add.do")
    public Result add(@RequestBody Map<String, String> map) {
        log.info("map:{}",map);
        return orderService.saveOrder(map);
    }


}
